import React from 'react';
import history from './utils/history';
import { Router, Route, Switch, Redirect } from 'react-router-dom';
import Login from '@/pages/Login';
import Layout from '@/pages/Layout';
import NotFound from '@/pages/NotFound';
import Edit from './pages/Profile/Edit';
import PrivateRoute from './components/PrivateRoute';
import Chat from './pages/Profile/Chat';
export default function App() {
  return (
    <div>
      <Router history={history}>
        <Switch>
          <Redirect from="/" to="/home" exact></Redirect>
          <Route path="/login">
            <Login></Login>
          </Route>
          <Route path="/home">
            <Layout></Layout>
          </Route>
          <PrivateRoute path="/profile/edit">
            <Edit></Edit>
          </PrivateRoute>
          <PrivateRoute path="/chat">
            <Chat></Chat>
          </PrivateRoute>
          <Route>
            <NotFound></NotFound>
          </Route>
        </Switch>
      </Router>
    </div>
  );
}
